package com.nika.usercenter.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.nika.usercenter.model.domain.Team;
import com.nika.usercenter.model.domain.User;
import com.nika.usercenter.model.dto.TeamQuery;
import com.nika.usercenter.model.request.TeamJoinRequest;
import com.nika.usercenter.model.request.TeamQuitRequest;
import com.nika.usercenter.model.request.TeamUpdateRequest;
import com.nika.usercenter.model.vo.TeamVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author nika
* @description 针对表【team(队伍)】的数据库操作Service
* @createDate 2022-09-01 14:37:55
*/
public interface TeamService extends IService<Team> {

    /**
     * 添加队伍
     * @return
     */
    long addTeam(Team team , User loginUser);

    /**
     * 查询队伍，返回给前端 队伍和创建者的信息
     * @param teamQuery
     * @param loginUser
     * @return
     */
    List<TeamVO> query(TeamQuery teamQuery, User loginUser);

    /**
     * 更新队伍
     * @param team
     * @return
     */
    boolean updateTeam(TeamUpdateRequest team, User loginUser);

    /**
     * 加入队伍
     * @param teamJoinRequest
     * @param request
     */
    boolean joinTeam(TeamJoinRequest teamJoinRequest, User loginUser);

    boolean quit(TeamQuitRequest teamQuitRequest, User loginUser);

    /**
     * 队长删除队伍
     * @param id
     * @param loginUser
     * @return
     */
    boolean delTeam(Long id, User loginUser);
}
